package com.aspose.cells.a.c;

import com.aspose.cells.DateTime;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class zk {
   private static final DateFormat a = DateFormat.getDateInstance(1);
   private static final DateFormat b = DateFormat.getTimeInstance(1);

   public static boolean a(DateTime var0, DateTime var1) {
      return var0.compareTo(var1) >= 0;
   }

   public static boolean b(DateTime var0, DateTime var1) {
      return var0.compareTo(var1) > 0;
   }

   public static boolean c(DateTime var0, DateTime var1) {
      return var0.compareTo(var1) <= 0;
   }

   public static boolean d(DateTime var0, DateTime var1) {
      return var0.compareTo(var1) < 0;
   }

   public static com.aspose.cells.b.a.zk e(DateTime var0, DateTime var1) {
      return var0.a(var1);
   }

   public static DateTime a(DateTime var0, com.aspose.cells.b.a.zk var1) {
      return var0.a(var1);
   }

   public static boolean a(Object var0) {
      return var0 instanceof DateTime || var0 instanceof Date || var0 instanceof Calendar;
   }

   public static int a(char[] var0, int var1, int var2) {
      while(var1 < var2) {
         switch(var0[var1]) {
         case 'D':
         case 'E':
         case 'F':
         case 'G':
         case 'H':
         case 'K':
         case 'M':
         case 'S':
         case 'W':
         case 'Z':
         case 'a':
         case 'd':
         case 'h':
         case 'k':
         case 'm':
         case 's':
         case 'w':
         case 'y':
         case 'z':
            ++var1;
            break;
         case 'I':
         case 'J':
         case 'L':
         case 'N':
         case 'O':
         case 'P':
         case 'Q':
         case 'R':
         case 'T':
         case 'U':
         case 'V':
         case 'X':
         case 'Y':
         case '[':
         case '\\':
         case ']':
         case '^':
         case '_':
         case '`':
         case 'b':
         case 'c':
         case 'e':
         case 'f':
         case 'g':
         case 'i':
         case 'j':
         case 'l':
         case 'n':
         case 'o':
         case 'p':
         case 'q':
         case 'r':
         case 't':
         case 'u':
         case 'v':
         case 'x':
         default:
            return var1;
         }
      }

      return var1;
   }

   public static String a(int var0, short var1) {
      return var0 < 3 ? "GG" : "GGGG";
   }

   public static String a() {
      return "E";
   }

   public static String b() {
      return "EEEE";
   }

   public static void a(StringBuilder var0, char var1) {
      switch(var1) {
      case '\'':
         var0.append("''");
         break;
      default:
         if (var0.length() > 0 && var0.charAt(var0.length() - 1) == '\'') {
            var0.setLength(var0.length() - 1);
         } else {
            var0.append('\'');
         }

         var0.append(var1);
         var0.append('\'');
      }

   }

   public static void a(StringBuilder var0, char[] var1, int var2, int var3) {
      boolean var4 = false;
      if (var0.length() > 0 && var0.charAt(var0.length() - 1) == '\'') {
         var0.setLength(var0.length() - 1);
         var4 = true;
      }

      for(; var2 < var3; ++var2) {
         if (var1[var2] == '\'') {
            if (var4) {
               var0.append("'''");
            } else {
               var0.append("''");
            }

            var4 = false;
         } else {
            if (!var4) {
               var0.append('\'');
               var4 = true;
            }

            var0.append(var1[var2]);
         }
      }

      if (var4) {
         var0.append('\'');
      }

   }

   public static DateTime a(String var0) {
      try {
         return new DateTime((new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'")).parse(var0));
      } catch (Exception var2) {
         throw new IllegalArgumentException("Invalid UTC time value: [" + var0 + "]. Required format: yyyy-MM-ddTHH:mm:ssZ");
      }
   }
}
